home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
UTIL
/
PRINTER
/
PCLTOOLS
/
ASC2PCL
/
rep_C
< prev
next >
Wrap
Text File
|
1996-06-27
|
2KB
|
95 lines
# Search and Replace patterns for ASC2PCL
# Enables context-sensitive printing of C/C++ source code
# Commentary lines start with a '#'. They may be placed anywhere
# except within the 4-line search/replace structure.
# Modes - Must start with '{' as first character.
# Format: identifier, internal font number, style, weight, scaling
# factor in promilles, indent in chars, scalex, scaley in promilles
{norm, 0,0,0,1000,0,1000,1000} mode 1 (standard text, Courier)
{comm, 0,1,3,1000,0,1000,1000} mode 2 (commentary Courier bd it)
{quote,0,1,0,1000,0,1000,1000} mode 3 (quote Courier it)
{func, 0,0,3,1000,0,1000,1000} mode 4 (function Courier bd)
{prep, 4,0,3,1500,0,1000,1000} mode 5 (preprocessor Univers bd)
# Search/Replace patterns - start with the first line that doesn't
# begin with a '{' (and isn't a commentary line). The first line is:
# offset when found, mode exception list in {...}, list of prefixes
# enclosed in {...}. If the first character in the prefixes list
# has to be '}' you have to represent it by \&7d.
# C functions
-1,{!norm},{ ,\&09,*,/,(,),{,},:,;,.,,,>,<,+,-,!,=,~,?}
\0\{\[a-zA-Z0-9_\]\[a-zA-Z0-9_\]\*\}\{\[ \&09\]\*\}(
\1exit\1for\1if\1return\1switch\1while
\0\m{func}\1\M{func}\2
# C functions at the start of a line
-1,{!norm},{\&00}
\&00\{\[a-zA-Z0-9_\]\[a-zA-Z0-9_\]\*\}\{\[ \&09\]\*\}(
\1exit\1for\1if\1return\1switch\1while
\m{func}\1\M{func}\2
# C commentaries on
0,{!norm},{/}
/\&2a
\M{norm}\m{comm}/\&2a
# C++ commentaries
0,{!norm},{/}
\{//*\}\n
\m{comm}\1\M{comm}
# C commentaries off
0,{!comm},{*}
\&2a/
\&2a/\M{comm}\m{norm}
# For consistency between #include "..." and #include <...>
0,{!norm},{#}
\{#\[ \&09\]\*include\}\{*\}<\{*\}>
\m{prep}\1\M{prep}\2\m{quote}<\3>\M{quote}
# C preprocessor
-1,{!norm},{#}
\{#\[ \&09\]\*\[a-z\]\[a-z\]\*\}\[ \n\&09\]
\m{prep}\1\M{prep}
# C double quoute on
0,{!norm},{"}
"
\M{norm}\m{quote}"
# C double quote off
0,{!quote},{"}
"
"\M{quote}\m{norm}
# C single quote
0,{!norm},{'}
'\{\[!'\]\*\}'
\m{quote}'\1'\M{quote}
# Escape sequences - to avoid other replacing rules being used within it.
0,{},{\&1b}
\{\&1b*\[A-Z\]\}
\1
# Tab code - preserve it!
0,{},{\&09}
\&09
\&09